﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/HomeSubMaster.Master" AutoEventWireup="true"
    CodeBehind="OrderOK.aspx.cs" Inherits="CSP.Web.MyHome.ConsumeOrder.OrderOK" %>

<asp:Content ID="CSPHead" ContentPlaceHolderID="CSPHead" runat="server">
    <meta charset="utf-8">
    <title>订单创建成功--信然贷网</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link href="/Styles/theme/base/main/common.css" rel="stylesheet">
    
</asp:Content>

<asp:Content ID="HomeStyle" ContentPlaceHolderID="HomeStyle" runat="server">
    <!-- page -->
    <link href="/Styles/theme/base/main/book.css" rel="stylesheet">
</asp:Content>


<asp:Content ID="CSPStyleAndScript" ContentPlaceHolderID="CSPStyleAndScript" runat="server">
    
    <script type="text/javascript">

    var online = new Array();
    
    var CSPContact={
        isFinded:false,
        contactWays:<%=ContactWayJson %>,
        Init:function (){
            var that=this;
            var qqFilePath='http://'+'webpresence.qq.com/getonline?'+encodeURI('Type=1&');
            var taobaoFilePath='http://'+'amos.alicdn.com/muliuserstatus.aw?beginnum=0&site=cntaobao&charset=utf-8&callback=<%=this.ClientID %>.SetContact&uids=';
            var taobaoi=0;
            $.each(this.contactWays,function(idex,item){
                /*1代表是QQ*/
                if(item.Type==1 ){
                    qqFilePath+=item.Address+":";
                }
                /*0代表淘宝*/
                if(item.Type==0){
                    if(taobaoi==0){
                        taobaoFilePath+=encodeURI(item.Address);
                    }else{
                        taobaoFilePath+=";"+encodeURI(item.Address);
                    }
                    
                    taobaoi++;
                }
            });
            //$.includeFile([qqFilePath]);
            $.ajax({
              type:"get",
              url: qqFilePath,
              cache:false ,
              dataType: "script",
              async:false,
              error:function(XMLHttpRequest, textStatus, errorThrown){
                var bbb="";
              },
              success:function (data, textStatus, jqXHR){
                that.SetContact();
              }
            });
            if(this.isFinded){
                return;
            }
            $.ajax({
              type:"get",
              url: taobaoFilePath,
              cache:false ,
              dataType: "script",
              async:false,
              error:function(XMLHttpRequest, textStatus, errorThrown){
                var bbb="";
              },
              success:function (data, textStatus, jqXHR){
                //that.SetContact();
              }
            });
//            document.write("<script src='"+taobaoFilePath+"'></"+"script>");
            //$.getScript(qqFilePath);
            if(!this.isFinded){
                this.SetContactByAddressAndType(this.contactWays[0].Address,this.contactWays[0].Type);
            }

            
        },
        SetContact:function(taobaoResponse){
            if(this.isFinded){
                return;
            }
            for(var i=0;i<online.length;i++){
                /*online*/
                if(online[i]==1){
                    var address=this.GetDataByQQ(i);
                    this.SetContactByAddressAndType(address,1);
                    this.isFinded=true;
                    return;
                }
            }
            if(taobaoResponse==undefined){
                return;
            }
            for(var i=0;i<taobaoResponse.data.length;i++){
                if(taobaoResponse.data[i]==1){
                    var address=this.GetDataByTaoBao(i);
                    this.SetContactByAddressAndType(address,0);
                    this.isFinded=true;
                    return;
                }
            }
        },
        GetDataByQQ:function(index){
            var result;
            var i=0;
            $.each(this.contactWays,function(idex,item){
                /*1代表是QQ*/
                if(item.Type==1){
                    if(i==index){
                        result= item.Address;
                        return;
                    }
                    i++;
                }
                
            });
            return result;
        },
        GetDataByTaoBao:function(index){
            var result;
            var i=0;
            $.each(this.contactWays,function(idex,item){
                /*0代表是淘宝*/
                if(item.Type==0){
                    if(i==index){
                        result= item.Address;
                        return;
                    }
                    i++;
                }
                
            });
            return result;
        },
        SetContactByAddressAndType:function(address,type){
            if(type==1){
                var qqhref="http://"+"wpa.qq.com/msgrd?v=3&amp;uin="+encodeURI(address)+"&amp;site=qq&amp;menu=yes";
                var qqsrc="http://"+"wpa.qq.com/pa?p=2:"+encodeURI(address)+":41";
                $("#contactLink").attr("href",qqhref);
                $("#contactImg").attr("src",qqsrc);
            }else if(type==0){
                var taobaohref="http://"+"www.taobao.com/webww/ww.php?ver=3&touid="+encodeURI(address)+"&siteid=cntaobao&status=1&charset=utf-8";
                var taobaosrc="http://"+"amos.alicdn.com/realonline.aw?v=2&uid="+encodeURI(address)+"&site=cntaobao&s=1&charset=utf-8";
                $("#contactLink").attr("href",taobaohref);
                $("#contactImg").attr("src",taobaosrc);
            }
        }
    }

        $().ready(function () {
            CSPContact.Init();
        });

    </script>
</asp:Content>

<asp:Content ID="CSPMain" ContentPlaceHolderID="CSPMain" runat="server">
    <div class="box-bd post-message home">
        <!-- {{{ flowsteps -->
        <div class="flowsteps">
            <ol class="num2">
                <li class="done"><span class="first">1. 填写预约信息</span></li>
                <li class="current"><span class="last">2. 预约成功</span></li>
            </ol>
        </div>
        <!-- flowsteps }}} -->
        <div class="post-cont mh500">
            <div class="post-ok">
                <h3>
                    恭喜您，课程预约成功！</h3>
                <p>
                    2小时之内您将收到预约信息的短信，请注意查收！</p>
                <div class="post-btn">
                    <a target="_blank" class="post-btn-a" href="/"><span>查看预约信息</span></a> <a class="post-btn-a"
                        href="/MyHome/Account/Management.aspx"><span>去我的信然贷</span></a> <a class="fc-blue" href="/search/?SearchValue=<%=ServiceTitle %>">继续查看相关课程</a>
                </div>
            </div>
            <div class="book-info">
                <div class="course">
                    <div class="sum-wrap">
                        <div class="summary">
                            <h3 class="course-title">
                                <a href="/detail/<%=Request["id"].ToString() %>.shtml">
                                    <asp:Label ID="LB_Title" runat="server" Text="Label"></asp:Label></a></h3>
                            <p class="old-price">
                                <del>原价：<strong><asp:Label ID="LB_OriginalPrice" runat="server" Text="Label"></asp:Label></strong>元/<asp:Label
                                    ID="LB_OriginalPriceUnit" runat="server" Text="Label"></asp:Label></del></p>
                            <p class="latest-price">
                                现价：<span class="price"><asp:Label ID="LB_Price" runat="server" Text="Label"></asp:Label></span>元/<asp:Label
                                    ID="LB_PriceUnit" runat="server" Text="Label"></asp:Label>
                            </p>
                            <p class="class-number">
                                开班人数：<asp:Label ID="LB_ClassOfMemberNumber" runat="server" Text="Label"></asp:Label>人</p>
                        </div>
                    </div>
                    <div class="photo-contact">
                        <div class="photo">
                            <a href="">
                                <img src="/images/org-photo.png" width="100" height="74" alt=""></a></div>
                    </div>
                </div>
                <div class="enterprise">
                    <div class="sever-name">
                        <p>
                            服务机构：<a href="/detail/<%=Request["id"].ToString() %>.shtml" class="name"><asp:Label
                                ID="LB_UserName" runat="server" Text="Label"></asp:Label></a> <a title="<%=AthenticationName %>"
                                    class="ico <%=AuthenticationStyle %>" href=""></a>
                        </p>
                        <p>
                            咨询电话：010-25142548</p>
                        <p>
                            客服在线：<a id="contactLink" href=""
                                target="_blank"><img border="0" id="contactImg" align="absmiddle" title="点击这里给我发消息"
                                    alt="点击这里给我发消息" src=""></a></p>
                        <p class="sever-local">
                            服务区域：<a><asp:Label ID="LB_Province" runat="server" Text=""></asp:Label></a>
                            <a >
                                <asp:Label ID="LB_City" runat="server" Text=""></asp:Label></a> <a>
                                    <asp:Label ID="LB_County" runat="server" Text=""></asp:Label></a>
                            <asp:Label ID="LB_Street" runat="server" Text=""></asp:Label>
                            <a  title="点击查看详细" class="ico i-local">查看详细</a></p>
                    </div>
                </div>
            </div>
            <!--book-info-->
        </div>
        <!--post-cont-->
    </div>
    <!--grid-m0-->
</asp:Content>
